package com.homework;

import java.util.ArrayList;
import java.util.Collections;

public class Test06 {
    public static void main(String[] args) {
        String a1="1";
        String a2="2";
        String a3="3";
        String a4="4";
        ArrayList<String> add = add(a1, a2, a3, a4);
        System.out.println(add);
    }

    private static ArrayList<String> add(String...str) {
        ArrayList<String> objects = new ArrayList<>();
        for (String s : str) {
            Collections.addAll(objects,s);
        }
        return objects;
    }
}
